#include "robot_state.h"

//static Robot_State robot_state = ROBOT_INIT;//整个系统的标志位
Robot_State robot_state = ROBOT_INIT;//整个系统的标志位
uint8_t is_chassis_init_done = SL_FALSE;
uint8_t is_gimbal_init_done = SL_FALSE;
uint8_t is_soc_2_init_done = SL_FALSE;


void set_robot_state(Robot_State new_robot_state) {
  if (new_robot_state != robot_state) {
    robot_state = new_robot_state;
  }
}

Robot_State get_robot_state(void)
{
     return robot_state;
}

void set_robot_state_chassis_init_done() { is_chassis_init_done = SL_TRUE; }

void set_robot_state_disk_init_done() { is_gimbal_init_done = SL_TRUE; }

void set_robot_state_soc_init_done() { is_soc_2_init_done = SL_TRUE; }

void reset_robot_state_chassis_init() { is_chassis_init_done = SL_FALSE; }

void reset_robot_state_disk_init() { is_gimbal_init_done = SL_FALSE; }

void reset_robot_state_soc_init_done() { is_soc_2_init_done = SL_FALSE; }

uint8_t is_robot_init_done() {
  return is_chassis_init_done && is_gimbal_init_done;
}

uint8_t is_soc_2_mcu_init_done() {
  return is_soc_2_init_done;
}
